OpenFlow (OpenFlow) is a core technology implementing software defined networking (SDN). In the technology, an original conventional switching mode (that is, a manner of packet forwarding completely controlled by a switch/router) is switched to an OpenFlow switching mode, and meanwhile, a conventional control plane is separated from a forwarding device, so that decision of all forwarding actions is migrated to an integrated controller. This implements separation between data forwarding and routing control. FIG. 1 is a schematic diagram of an OpenFlow network architecture in the prior art. As shown in FIG. 1, an OpenFlow network includes a controller and multiple switches. The controller controls all switches in the OpenFlow network. In the OpenFlow network, the controller first obtains related information of a data flow by means of initial-packet reporting; views, by means of the OpenFlow protocol, an OpenFlow flow table already delivered to the switches and a network status; obtains network topology info/Ration and network status information; selects an optimal path and corresponding quality of service control for the data flow according to quality of service (QoS) (for example, bandwidth, or a priority) requirements, the network topology information, and the network status information that are learned by the controller; and delivers the selected optimal path to the switches in a form of OpenFlow flow table, so that the switches perform data flow forwarding according to the OpenFlow flow table delivered by the controller. A communications network between the controller and the switches is a control plane, and a data forwarding network between switches is a data plane.
In an actual application, a hybrid (hybrid) switch is generally used in the OpenFlow network, and the hybrid switch supports two working modes: OpenFlow switching and conventional switching. When a problem occurs in a control plane network, and the switch is disconnected from the controller, the switch may enter a “fail standalone mode (fail standalone mode)” according to a preconfigured OpenFlow configuration management protocol (OF-config), that is, switch from an OpenFlow switching mode to a conventional switching mode. The switch generates a hardware forwarding table according to the conventional layer 2 forwarding technology or layer 3 routing protocol, and delivers the hardware forwarding table to a forwarding chip (ASIC) dedicated for the switch or to a network processor (NP), so that the ASIC or NP processes the data flow according to the hardware forwarding table, and directly sends a data flow matching a forwarding condition to a corresponding port.
Because in different working modes, the switch in the OpenFlow network uses different methods to obtain or calculate switching and routing information, and data structure manners for saving routing and switching information are different, the controller cannot view routing and switching information that is in the conventional mode and that is stored in the switch. When a connection between the controller and the switch resumes, and the switch switches from the conventional switching mode to the OpenFlow switching mode, generally, the switch may clear a hardware forwarding entry in the conventional switching mode. Therefore, the controller generates a new OpenFlow flow table not according to the current network topology information, and performs data forwarding. However, this may cause temporary interruption of a network service. Therefore, to ensure continuity of the network service, the controller needs to view, by means of the OpenFlow protocol, routing and switching information in the hardware forwarding entry in the current conventional switch mode, obtain current network topology information, perform global network topology control and optimization, generate a new OpenFlow flow table, and perform data forwarding. However, in the prior art, when the switch switches from the conventional switching mode to the OpenFlow switching mode, no method for representing, in a form of OpenFlow flow table, routing and switching information in a hardware forwarding entry in a conventional switching mode is provided.